home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xfig2 / patch3 < prev    next >
Encoding:
Internet Message Format  |  1993-04-28  |  11.6 KB

  1. From: argv%turnpike@Sun.COM (Dan Heller)
  2. Newsgroups: comp.sources.x
  3. Subject: v06i024: xfig 2.0, Patch3
  4. Message-ID: <132641@sun.Eng.Sun.COM>
  5. Date: 7 Mar 90 19:56:29 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
  9. Posting-number: Volume 6, Issue 24
  10. Archive-name: xfig2/patch3
  11. Patch-To: xfig2: volume 6, issues 9-23
  12.  
  13. The first part of this file is a whole new file "CHANGES".
  14. Split it off (down to just before the "PATCH BEGINS HERE") and
  15. run it through sh to extract the file.
  16. Run the rest of this file through "patch".
  17.  
  18. For any problems e-mail to bvsmith@lbl.gov
  19. - Brian Smith
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of shell archive."
  28. # Contents:  CHANGES
  29. # Wrapped by envbvs@epb2.lbl.gov on Wed Feb 28 13:50:00 1990
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'CHANGES'\"
  33. else
  34. echo shar: Extracting \"'CHANGES'\" \(586 characters\)
  35. sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
  36. XVersion 2.0 
  37. X
  38. XPatchlevel 3
  39. XChanges from patchlevel 2:
  40. X
  41. Xo now uses XtAddTimer instead of setitimer() for blinking cursor
  42. Xo Changed include directives for Athena widgets to include/X11/Xaw directory
  43. Xo added put_fmsg() to print messages with floating point numbers
  44. X  Some machines (MIPS) were dumping core when passing floats as ints.
  45. X
  46. XPatchlevel 2
  47. XChanges from patchlevel 1:
  48. X
  49. Xo removed call to free() in curve() which was causing coredumps
  50. Xo Imakefile had .o filenames in SRCS definition
  51. X
  52. X
  53. XPatchlevel 1
  54. XChanges from patchlevel 0:
  55. X
  56. Xo included definition of put_msg()/FREE/CFREE in f2ps.c
  57. X
  58. END_OF_FILE
  59. if test 586 -ne `wc -c <'CHANGES'`; then
  60.     echo shar: \"'CHANGES'\" unpacked with wrong size!
  61. fi
  62. # end of 'CHANGES'
  63. fi
  64. echo shar: End of shell archive.
  65. exit 0
  66.  
  67. **************** PATCH BEGINS HERE ********************
  68.  
  69. *** blink.c.p3    Tue Jan 16 17:21:03 1990
  70. --- blink.c    Wed Feb 28 13:45:22 1990
  71. ***************
  72. *** 8,19
  73.   */
  74.   #include "fig.h"
  75.   
  76. ! static int        cursor_on, cursor_is_moving;
  77. ! static int        cursor_x, cursor_y;
  78. ! static int        blink();
  79. ! static int        (*erase)();
  80. ! static int        (*draw)();
  81. ! static struct itimerval    blink_timer;
  82.   
  83.   turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, sec, usec)
  84.   int    (*draw_cursor)();
  85.  
  86. --- 8,19 -----
  87.   */
  88.   #include "fig.h"
  89.   
  90. ! static    int        cursor_on, cursor_is_moving;
  91. ! static    int        cursor_x, cursor_y;
  92. ! static    int        blink();
  93. ! static    int        (*erase)();
  94. ! static    int        (*draw)();
  95. ! static    unsigned long    blink_timer;
  96.   
  97.   static    XtIntervalId blinkid; 
  98.   static    int stop_blinking=FALSE;
  99. ***************
  100. *** 15,21
  101.   static int        (*draw)();
  102.   static struct itimerval    blink_timer;
  103.   
  104. ! turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, sec, usec)
  105.   int    (*draw_cursor)();
  106.   int    (*erase_cursor)();
  107.   int    x, y;
  108.  
  109. --- 15,25 -----
  110.   static    int        (*draw)();
  111.   static    unsigned long    blink_timer;
  112.   
  113. ! static    XtIntervalId blinkid; 
  114. ! static    int stop_blinking=FALSE;
  115. ! static    int cur_is_blinking=FALSE;
  116. ! turn_on_blinking_cursor(draw_cursor, erase_cursor, x, y, msec)
  117.   int    (*draw_cursor)();
  118.   int    (*erase_cursor)();
  119.   int    x, y;
  120. ***************
  121. *** 19,25
  122.   int    (*draw_cursor)();
  123.   int    (*erase_cursor)();
  124.   int    x, y;
  125. ! long    sec, usec;
  126.   {
  127.       draw = draw_cursor;
  128.       erase = erase_cursor;
  129.  
  130. --- 23,29 -----
  131.   int    (*draw_cursor)();
  132.   int    (*erase_cursor)();
  133.   int    x, y;
  134. ! unsigned long msec;
  135.   {
  136.       draw = draw_cursor;
  137.       erase = erase_cursor;
  138. ***************
  139. *** 26,35
  140.       cursor_is_moving = 0;
  141.       cursor_x = x;
  142.       cursor_y = y;
  143. !     blink_timer.it_interval.tv_usec = usec;
  144. !     blink_timer.it_interval.tv_sec = sec;
  145. !     blink_timer.it_value.tv_usec = usec;
  146. !     blink_timer.it_value.tv_sec = sec;
  147.       draw(x, y);
  148.       cursor_on = 1;
  149.       signal(SIGALRM, blink);
  150.  
  151. --- 30,36 -----
  152.       cursor_is_moving = 0;
  153.       cursor_x = x;
  154.       cursor_y = y;
  155. !     blink_timer = msec;
  156.       draw(x, y);
  157.       cursor_on = 1;
  158.       if (!cur_is_blinking)    /* if we are already blinking, don't request another */
  159. ***************
  160. *** 32,42
  161.       blink_timer.it_value.tv_sec = sec;
  162.       draw(x, y);
  163.       cursor_on = 1;
  164. !     signal(SIGALRM, blink);
  165. !     setitimer(ITIMER_REAL, &blink_timer, (struct itimerval *)0);
  166. !     /*
  167. !     (void) notify_set_itimer_func(&me, blink, ITIMER_REAL, &blink_timer, 0);
  168. !     */
  169.       }
  170.   
  171.   turn_off_blinking_cursor()
  172.  
  173. --- 33,44 -----
  174.       blink_timer = msec;
  175.       draw(x, y);
  176.       cursor_on = 1;
  177. !     if (!cur_is_blinking)    /* if we are already blinking, don't request another */
  178. !         {
  179. !         blinkid = XtAddTimeOut(blink_timer, blink, 0);
  180. !         cur_is_blinking=TRUE;
  181. !         }
  182. !     stop_blinking = FALSE;
  183.       }
  184.   
  185.   turn_off_blinking_cursor(client_data,id)
  186. ***************
  187. *** 39,45
  188.       */
  189.       }
  190.   
  191. ! turn_off_blinking_cursor()
  192.   {
  193.       if (cursor_on) erase(cursor_x, cursor_y);
  194.       blink_timer.it_interval.tv_usec = 0;
  195.  
  196. --- 41,49 -----
  197.       stop_blinking = FALSE;
  198.       }
  199.   
  200. ! turn_off_blinking_cursor(client_data,id)
  201. ! XtPointer client_data;
  202. ! XtIntervalId *id;
  203.   {
  204.       if (cursor_on) 
  205.           erase(cursor_x, cursor_y);
  206. ***************
  207. *** 41,56
  208.   
  209.   turn_off_blinking_cursor()
  210.   {
  211. !     if (cursor_on) erase(cursor_x, cursor_y);
  212. !     blink_timer.it_interval.tv_usec = 0;
  213. !     blink_timer.it_interval.tv_sec = 0;
  214. !     blink_timer.it_value.tv_usec = 0;
  215. !     blink_timer.it_value.tv_sec = 0;
  216. !     setitimer(ITIMER_REAL, &blink_timer, (struct itimerval *)0);
  217. !     /*
  218. !     (void) notify_set_itimer_func(&me, blink, ITIMER_REAL, 0, 0);
  219. !     */
  220. !     draw = erase = NULL;
  221.       }
  222.   
  223.   static
  224.  
  225. --- 45,53 -----
  226.   XtPointer client_data;
  227.   XtIntervalId *id;
  228.   {
  229. !     if (cursor_on) 
  230. !         erase(cursor_x, cursor_y);
  231. !     stop_blinking = TRUE;
  232.       }
  233.   
  234.   static
  235. ***************
  236. *** 56,65
  237.   static
  238.   blink()
  239.   {
  240. !     if (cursor_is_moving) return(0);
  241. !     if (cursor_on) {
  242. !         erase(cursor_x, cursor_y);
  243. !         cursor_on = 0;
  244.           }
  245.       else {
  246.           draw(cursor_x, cursor_y);
  247.  
  248. --- 53,69 -----
  249.   static
  250.   blink()
  251.   {
  252. !     if (!stop_blinking)
  253. !         {
  254. !         if (cursor_is_moving) 
  255. !         return(0);
  256. !         if (cursor_on) {
  257. !         erase(cursor_x, cursor_y);
  258. !         cursor_on = 0;
  259. !         }
  260. !         else {
  261. !         draw(cursor_x, cursor_y);
  262. !         cursor_on = 1;
  263.           }
  264.           blinkid = XtAddTimeOut(blink_timer, blink, 0);
  265.           }
  266. ***************
  267. *** 61,69
  268.           erase(cursor_x, cursor_y);
  269.           cursor_on = 0;
  270.           }
  271. !     else {
  272. !         draw(cursor_x, cursor_y);
  273. !         cursor_on = 1;
  274.           }
  275.       return(0);
  276.       }
  277.  
  278. --- 65,76 -----
  279.           draw(cursor_x, cursor_y);
  280.           cursor_on = 1;
  281.           }
  282. !         blinkid = XtAddTimeOut(blink_timer, blink, 0);
  283. !         }
  284. !     else
  285. !         {
  286. !         stop_blinking = FALSE;    /* signal that we've stopped */
  287. !         cur_is_blinking = FALSE;
  288.           }
  289.       return(0);
  290.       }
  291. *** char.c.orig    Tue Jan 16 17:21:03 1990
  292. --- char.c    Wed Feb 28 12:11:43 1990
  293. ***************
  294. *** 16,21
  295.   extern int        cur_font, cur_fontsize;
  296.   extern int        cur_texttype;
  297.   
  298.   #define            BUF_SIZE    400
  299.       
  300.   char            prefix[BUF_SIZE],    /* part of string left of mouse click */
  301.  
  302. --- 16,22 -----
  303.   extern int        cur_font, cur_fontsize;
  304.   extern int        cur_texttype;
  305.   
  306. + #define            BLINK_INTERVAL    700    /* milliseconds blink rate */
  307.   #define            BUF_SIZE    400
  308.       
  309.   char            prefix[BUF_SIZE],    /* part of string left of mouse click */
  310. ***************
  311. *** 53,59
  312.       char_ht = char_height(canvas_font);
  313.       char_received = 0;
  314.       turn_on_blinking_cursor(draw_cursor, draw_cursor,
  315. !                 cur_x, cur_y, (long)0, (long)700000);
  316.       }
  317.   
  318.   terminate_char_handler()
  319.  
  320. --- 54,60 -----
  321.       char_ht = char_height(canvas_font);
  322.       char_received = 0;
  323.       turn_on_blinking_cursor(draw_cursor, draw_cursor,
  324. !                 cur_x, cur_y, (long)BLINK_INTERVAL);
  325.       }
  326.   
  327.   terminate_char_handler()
  328. *** fig.h.orig    Thu Feb 22 15:49:10 1990
  329. --- fig.h    Tue Feb 27 08:59:25 1990
  330. ***************
  331. *** 27,33
  332.   #include <X11/Xlib.h>
  333.   #include <X11/cursorfont.h>
  334.   #include <X11/Intrinsic.h>
  335. - #include <X11/Scroll.h>
  336.   #include <X11/StringDefs.h>
  337.   #include <X11/Shell.h>
  338.   #include <X11/Command.h>
  339.  
  340. --- 27,32 -----
  341.   #include <X11/Xlib.h>
  342.   #include <X11/cursorfont.h>
  343.   #include <X11/Intrinsic.h>
  344.   #include <X11/StringDefs.h>
  345.   #include <X11/Shell.h>
  346.   
  347. ***************
  348. *** 30,35
  349.   #include <X11/Scroll.h>
  350.   #include <X11/StringDefs.h>
  351.   #include <X11/Shell.h>
  352.   #include <X11/Command.h>
  353.   #include <X11/Label.h>
  354.   #include <X11/Dialog.h>
  355.  
  356. --- 29,44 -----
  357.   #include <X11/Intrinsic.h>
  358.   #include <X11/StringDefs.h>
  359.   #include <X11/Shell.h>
  360. + /* R4 */
  361. + #if XtSpecificationRelease >= 4
  362. + #include <X11/Xaw/Command.h>
  363. + #include <X11/Xaw/Label.h>
  364. + #include <X11/Xaw/Dialog.h>
  365. + #include <X11/Xaw/Box.h>
  366. + #include <X11/Xaw/Form.h>
  367. + /* R3 */
  368. + #else
  369.   #include <X11/Command.h>
  370.   #include <X11/Label.h>
  371.   #include <X11/Dialog.h>
  372. ***************
  373. *** 35,40
  374.   #include <X11/Dialog.h>
  375.   #include <X11/Box.h>
  376.   #include <X11/Form.h>
  377.   
  378.   #ifdef sparc
  379.   
  380.  
  381. --- 44,50 -----
  382.   #include <X11/Dialog.h>
  383.   #include <X11/Box.h>
  384.   #include <X11/Form.h>
  385. + #endif
  386.   
  387.   #ifdef sparc
  388.   
  389. *** msgsw.c.orig    Tue Jan 16 17:21:07 1990
  390. --- msgsw.c    Mon Feb 26 16:49:39 1990
  391. ***************
  392. *** 36,41
  393.   /*****************  exported  variables and procedures   *****************/
  394.   
  395.               put_msg();
  396.               init_msgreceiving();
  397.   
  398.   /************************  local variables and routines ******************/
  399.  
  400. --- 36,42 -----
  401.   /*****************  exported  variables and procedures   *****************/
  402.   
  403.               put_msg();
  404. +             put_fmsg();
  405.               init_msgreceiving();
  406.   
  407.   /************************  local variables and routines ******************/
  408. ***************
  409. *** 111,116
  410.   put_msg(format, arg1, arg2, arg3, arg4, arg5)
  411.       char    *format;
  412.       int    arg1, arg2, arg3, arg4, arg5;
  413.   {
  414.       sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
  415.       msg_args[4].value = (XtArgVal)prompt;
  416.  
  417. --- 112,129 -----
  418.   put_msg(format, arg1, arg2, arg3, arg4, arg5)
  419.       char    *format;
  420.       int    arg1, arg2, arg3, arg4, arg5;
  421. + {
  422. +     sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
  423. +     msg_args[4].value = (XtArgVal)prompt;
  424. +     XtSetValues(msg_sw, &msg_args[4], 1);
  425. + }
  426. + /* floating point version - MIPS (DEC3100) doesn't like ints where floats are used */
  427. + /*VARARGS1*/
  428. + put_fmsg(format, arg1, arg2, arg3, arg4, arg5)
  429. +     char    *format;
  430. +     float    arg1, arg2, arg3, arg4, arg5;
  431.   {
  432.       sprintf(prompt, format, arg1, arg2, arg3, arg4, arg5);
  433.       msg_args[4].value = (XtArgVal)prompt;
  434. *** panel.c.orig    Mon Feb 19 11:10:47 1990
  435. --- panel.c    Mon Feb 26 16:41:18 1990
  436. ***************
  437. *** 944,950
  438.           break;
  439.           case F_FILL :
  440.           fill_mode = 1;
  441. !         put_msg("FILL MODE (gray level = %.2f)",
  442.                   1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  443.           break;
  444.           }
  445.  
  446. --- 944,950 -----
  447.           break;
  448.           case F_FILL :
  449.           fill_mode = 1;
  450. !         put_fmsg("FILL MODE (gray level = %.2f)",
  451.                   1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  452.           break;
  453.           }
  454. ***************
  455. *** 1124,1130
  456.       /* put fill pixmap in widget background */
  457.       indicator_panel_args[15].value = ind_fill_pm[cur_areafill-1]; 
  458.       XtSetValues(fill_panel, &indicator_panel_args[15], 1);
  459. !     put_msg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  460.       }
  461.   
  462.   /* save_n_exit */
  463.  
  464. --- 1124,1130 -----
  465.       /* put fill pixmap in widget background */
  466.       indicator_panel_args[15].value = ind_fill_pm[cur_areafill-1]; 
  467.       XtSetValues(fill_panel, &indicator_panel_args[15], 1);
  468. !     put_fmsg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
  469.       }
  470.   
  471.   /* save_n_exit */
  472. *** patchlevel.h.p2    Wed Feb 28 13:27:19 1990
  473. --- patchlevel.h    Tue Feb 27 09:22:42 1990
  474. ***************
  475. *** 1
  476. ! #define PATCHLEVEL 2
  477.  
  478. --- 1 -----
  479. ! #define PATCHLEVEL 3
  480.  
  481. dan
  482. -----------------------------------------------------------
  483.             O'Reilly && Associates
  484.         argv@sun.com / argv@ora.com
  485.        632 Petaluma Ave, Sebastopol, CA 95472 
  486.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  487.     Opinions expressed reflect those of the author only.
  488.